Namespace DataStream

    ''' <summary>
    ''' Specifies if a StreamReciever is a producer of variables or consumes them only
    ''' </summary>
    ''' <remarks>Use Producer if you add variables to the streams to ensure they are added before
    ''' they hit all other controls</remarks>
    <ObfuscationAttribute(Exclude:=True, ApplyToMembers:=True)> _
    Public Enum StreamRecieveType
        eStreamProducer
        eStreamConsumeOnly
    End Enum

    ''' <summary>
    ''' Specifies that a contol will accept a variable steam and can handle it internaly
    ''' </summary>
    ''' <remarks></remarks>
    <ObfuscationAttribute(Exclude:=True, ApplyToMembers:=True)> _
    Public Interface IStreamRecieve
        Inherits INamed

        ''' <summary>
        ''' Handles a stream
        ''' </summary>
        ''' <param name="Stream"></param>
        ''' <remarks></remarks>
        Sub RecieveStream(ByVal Stream As Stream)

        ''' <summary>
        ''' Handles a Stream Seek event
        ''' </summary>
        ''' <param name="Stream"></param>
        ''' <remarks></remarks>
        Sub RecieveSeek(ByVal Stream As Stream)

        ''' <summary>
        ''' Specifies that this control has requested to be refreshed
        ''' </summary>
        ''' <remarks></remarks>
        Event RequestRefresh As EventHandler

        ''' <summary>
        ''' Seeks the a data stream to a specific point
        ''' </summary>
        ''' <remarks></remarks>
        Event Seek As EventHandler(Of StreamSeekEventArgs)

        ''' <summary>
        ''' Restricts a current data stream to a specific range.
        ''' </summary>
        ''' <remarks></remarks>
        Event Restrict As EventHandler(Of StreamRestrictEventArgs)

        ''' <summary>
        ''' Causes the current Object to be Closed/Removed
        ''' </summary>
        ''' <remarks></remarks>
        Event Close As EventHandler

        ReadOnly Property RecieverType() As StreamRecieveType

    End Interface

    ''' <summary>
    ''' Seek Event Arguments. Speicifes if the Index in which to seek of a data stream
    ''' </summary>
    ''' <remarks></remarks>
    <Serializable(), ObfuscationAttribute(Exclude:=True, ApplyToMembers:=True)> _
    Public Class StreamSeekEventArgs
        Inherits System.EventArgs

        Private mSeekIndex As Integer

        Sub New(ByVal Index As Integer)
            mSeekIndex = Index
        End Sub

        Public ReadOnly Property Index() As Integer
            Get
                Return mSeekIndex
            End Get
        End Property

    End Class

    ''' <summary>
    ''' Restrict Event Arguments. Speicified a range of index in which to restrict a data stream
    ''' </summary>
    ''' <remarks></remarks>
    <Serializable(), ObfuscationAttribute(Exclude:=True, ApplyToMembers:=True)> _
    Public Class StreamRestrictEventArgs
        Inherits System.EventArgs

        Private mStartIndex As Integer
        Private mEndIndex As Integer

        Sub New(ByVal Start As Integer, ByVal [End] As Integer)
            mStartIndex = Start
            mEndIndex = [End]
        End Sub

        Public ReadOnly Property StartIndex() As Integer
            Get
                Return mStartIndex
            End Get
        End Property

        Public ReadOnly Property EndIndex() As Integer
            Get
                Return mEndIndex
            End Get
        End Property


    End Class


End Namespace
